<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title><?php echo $_page_title; ?></title>
    <meta name="keywords" content="<?php echo $_page_keywords; ?>"/>
    <meta name="description" content="<?php echo $_page_description; ?>"/>
    <link rel="stylesheet" href="/Public/Home/style/base.css" type="text/css">
    <link rel="stylesheet" href="/Public/Home/style/global.css" type="text/css">
    <link rel="stylesheet" href="/Public/Home/style/header.css" type="text/css">
    <link rel="stylesheet" href="/Public/Home/style/bottomnav.css" type="text/css">
    <link rel="stylesheet" href="/Public/Home/style/footer.css" type="text/css">

    <script type="text/javascript" src="/Public/Home/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/Public/Home/js/header.js"></script>

</head>
<body>
<!-- 顶部导航 start -->
<div class="topnav">
    <div class="topnav_bd w1210 bc">
        <div class="topnav_left">

        </div>
        <div class="topnav_right fr">
            <ul>
                <li id="logInfo"></li>
                <li class="line">|</li>
                <li><a href="<?php echo U('My/order?id='.session('m_id')); ?>">我的订单</a></li>
            </ul>
        </div>
    </div>
</div>
<!-- 顶部导航 end -->
<div style="clear:both;"></div>



<link rel="stylesheet" href="/Public/Home/style/list.css" type="text/css">
<link rel="stylesheet" href="/Public/Home/style/common.css" type="text/css">
<script type="text/javascript" src="/Public/Home/js/list.js"></script>

<style>
    .cart_div_list{opacity: 0.1;}
</style>
<!-- 头部 start -->
<div class="header w1210 bc mt15">
    <!-- 头部上半部分 start 包括 logo、搜索、用户中心和购物车结算 -->
    <div class="logo w1210">
        <h1 class="fl"><a href="<?php echo U('Index/index');?>"><img src="/Public/Home/images/20170401.jpg" alt="京西商城"></a></h1>
        <!-- 头部搜索 start -->
        <div class="search fl">
            <div class="search_form">
                <div class="form_left fl"></div>
                <form name="serarch" method="get" class="fl">
                    <input type="text" id="key" name="key" class="txt" value="<?php echo I('get.key','请输入商品关键字'); ?>" />
                    <input onclick="location.href='<?php echo U('Search/key_search','',false); ?>/key/'+$('#key').val(); " type="button" class="btn" value="搜索"/>
                </form>
                <div class="form_right fl"></div>
            </div>

            <div style="clear:both;"></div>
        </div>
        <!-- 头部搜索 end -->

        <!-- 用户中心 start-->
        <div class="user fl">
            <dl>
                <dt>
                    <em></em>
                    <a href="<?php echo U('Member/lst?id='.session('m_id')); ?>">用户中心</a>
                    <b></b>
                </dt>
                <dd>
                    <?php if(session('m_id')): ?>
                    <div class="prompt">
                        您好，<?php echo session('m_nickname'); ?>
                    </div>
                    <?php else: ?>
                    <div class="prompt">
                        您好，请<a href="<?php echo U('Member/login');?>">登录</a>
                    </div>
                    <?php endif; ?>
                    <div class="uclist mt10">
                        <ul class="list1 fl">
                            <li><a href="<?php echo U('Member/lst?id='.session('m_id')); ?>">用户信息></a></li>
                            <li><a href="<?php echo U('My/order'); ?>">我的订单></a></li>
                            <li><a href="<?php echo U('UserAddress/lst?member_id='.session('m_id'));?>">收货地址></a></li>
                            <li><a href="">我的收藏></a></li>
                        </ul>
                        <ul class="fl">
                            <li><a href="<?php echo U('My/edit?id='.session('m_id')); ?>">修改信息></a></li>
                            <li><a href="">我的红包></a></li>
                            <li><a href="">我的评论></a></li>
                            <li><a href="">资金管理></a></li>
                        </ul>
                    </div>
                    <div style="clear:both;"></div>
                </dd>
            </dl>
        </div>
        <!-- 用户中心 end-->

        <!-- 购物车 start -->
        <div class="cart fl">
            <dl>
                <dt>
                    <a id="cart_list" href="<?php echo U('Cart/lst'); ?>">去购物车结算</a>
                    <b></b>
                </dt>
                <dd>
                    <div class="prompt" id="cart_div_list">
                        <img src="/Public/Home/images/loading.gif"/>
                    </div>
                </dd>
            </dl>
        </div>
        <!-- 购物车 end -->
    </div>
    <!-- 头部上半部分 end -->

    <div style="clear:both;"></div>

    <!-- 导航条部分 start -->
    <div class="nav w1210 bc mt10">
        <!--  商品分类部分 start-->
        <div class="category fl <?php if($_show_nav == 0) echo 'cat1'; ?>"> <!-- 非首页，需要添加cat1类 -->
            <div class="cat_hd <?php if($_show_nav == 0) echo 'off'; ?>">  <!-- 注意，首页在此div上只需要添加cat_hd类，非首页，默认收缩分类时添加上off类，鼠标滑过时展开菜单则将off类换成on类 -->
                <h2>全部商品分类</h2>
                <em></em>
            </div>
            <div class="cat_bd <?php if($_show_nav == 0) echo 'none'; ?>">
                <?php foreach($catData as $k => $v): ?>
                <div class="cat <?php if($k==0) echo 'item1'; ?>">
                    <h3><a href="<?php echo U('Search/cat_search?cat_id='.$v['id'],'',false); ?>"><?php echo $v['cat_name']; ?></a> <b></b></h3>
                    <div class="cat_detail none">
                        <?php foreach($v['children'] as $k1 => $v1): ?>
                        <dl <?php if($k1==0) echo 'class="dl_1st"'; ?>>
                            <dt><a href="<?php echo U('Search/cat_search?cat_id='.$v1['id'],'',false); ?>"><?php echo $v1['cat_name']; ?></a></dt>
                            <dd>
                                <?php foreach($v1['children'] as $k2 => $v2): ?>
                                <a href="<?php echo U('Search/cat_search?cat_id='.$v2['id'],'',false); ?>"><?php echo $v2['cat_name']; ?></a>
                                <?php endforeach; ?>
                            </dd>
                        </dl>
                        <?php endforeach; ?>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
        <!--  商品分类部分 end-->

        <div class="navitems fl">
            <ul class="fl">
                <li class="current"><a href="<?php echo U('Home/Index/index');?>">首页</a></li>
                <li><a href="">电脑频道</a></li>
                <li><a href="">家用电器</a></li>
                <li><a href="">品牌大全</a></li>
                <li><a href="">团购</a></li>
                <li><a href="">积分商城</a></li>
                <li><a href="">夺宝奇兵</a></li>
            </ul>
            <div class="right_corner fl"></div>
        </div>
    </div>
    <!-- 导航条部分 end -->
</div>
<!-- 头部 end-->

<div style="clear:both;"></div>

<script>
    <?php $ic = C('IMAGE_CONFIG'); ?>

    var picView = "<?php echo $ic['viewPath']; ?>";
    $("#cart_list").mouseover(function () {
        $.ajax({
            type : "GET",
            url  : "<?php echo U('Cart/ajaxCartList'); ?>",
            dataType : "json",
            success :function (data) {
                var html = "<table style='width:100%;background-color:white;z-index:10;'>";
                $(data).each(function (k,v) {
                    html += '<tr>';
                    html += '<td><img width="50" src="'+picView+v.mid_logo+'" /></td>';
                    html += '<td>'+v.goods_name+'</td>';
                    html += '</tr>';
                });
                html += "</table>";
                $("#cart_div_list").html(html);
            }
        });
    });

</script>

<style>
    .page{text-align: right;}
    .page ul li {float:left;text-align: center}
</style>
<!-- 列表主体 start -->
<div class="list w1210 bc mt10">
    <!-- 面包屑导航 start -->
    <div class="breadcrumb">
        <h2>当前位置：<a href="">首页</a> > <a href="">电脑、办公</a></h2>
    </div>
    <!-- 面包屑导航 end -->

    <!-- 左侧内容 start -->
    <div class="list_left fl mt10">

        <div style="clear:both;"></div>

        <!-- 新品推荐 start -->
        <div class="newgoods leftbar mt10">
            <h2><strong>新品推荐</strong></h2>
            <div class="leftbar_wrap">
                <ul>
                    <?php foreach($goods4 as $k => $v): ?>
                    <li>
                        <dl>
                            <dt><a href="<?php echo U('Index/goods?id='.$v['id']); ?>"><?php showImage($v['mid_logo']); ?></a></dt>
                            <dd><a href="<?php echo U('Index/goods?id='.$v['id']); ?>"><?php echo $v['goods_name'];?></a></dd>
                            <dd><strong>￥<?php echo $v['shop_price'];?></strong></dd>
                        </dl>
                    </li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
        <!-- 新品推荐 end -->

        <!-- 最近浏览 start -->
        <div class="viewd leftbar mt10">
            <h2><a href="">清空</a><strong>最近浏览过的商品</strong></h2>
            <div class="leftbar_wrap" id="display_history"></div>
        </div>
        <!-- 最近浏览 end -->
    </div>
    <!-- 左侧内容 end -->

    <!-- 列表内容 start -->
    <div class="list_bd fl ml10 mt10">
        <!-- 热卖、促销 start -->
        <div class="list_top">
            <!-- 热卖推荐 start -->
            <div class="hotsale fl">
                <h2><strong><span class="none">热卖推荐</span></strong></h2>
                <ul>
                    <?php foreach($goods3 as $k=>$v):?>
                    <li>
                        <dl>
                            <dt><a href="<?php echo U('goods?id='.$v['id']); ?>"><?php showImage($v['mid_logo']);?></a></dt>
                            <dd class="name"><a href="<?php echo U('goods?id='.$v['id']); ?>"><?php echo $v['goods_name'];?></a></dd>
                            <dd class="price">特价：<strong>￥<?php echo $v['shop_price'];?></strong></dd>
                            <dd class="buy"><a href="<?php echo U('Index/goods?id='.$v['id']);?>"><span>立即抢购</span></a></dd>
                        </dl>
                    </li>
                    <?php endforeach; ?>
                </ul>
            </div>
            <!-- 热卖推荐 end -->

        </div>
        <!-- 热卖、促销 end -->

        <div style="clear:both;"></div>
        <div id="search_condition">
            当前搜素条件：
            <?php
 $brandId = I('get.brand_id'); if($brandId): ?>
                    <span>
                        品牌：<?php echo ltrim(strstr($brandId,'-'),'-'); ?>
                        <a href="<?php echo filterUrl('brand_id'); ?>">X</a>
                    </span>
                <?php endif; ?>
            <?php
 $price = I('get.price'); if($price): ?>
                    <span>
                        价格：<?php echo $price; ?>
                        <a href="<?php echo filterUrl('price'); ?>">X</a>
                    </span>
                <?php endif; ?>
            <?php
 foreach($_GET as $k => $v): if(strpos($k,'attr_') === 0): $_attrName = strrchr($v,'-'); ?>
            <span>
                <?php echo ltrim($_attrName,'-'); ?>:<?php echo str_replace($_attrName,'',$v); ?>
                <a href="<?php echo filterUrl($k); ?>">X</a>
            </span>
            <?php endif; endforeach; ?>
        </div>
        <!-- 商品筛选 start -->
        <div class="filter mt10">
            <h2> <strong>商品筛选</strong></h2>
            <div class="filter_wrap">
                <?php if(!I('get.brand_id')): ?>
                <dl>
                    <dt>品牌：</dt>
                    <?php foreach($searchFilter['brand'] as $k => $v): ?>
                    <dd><a href="/index.php/Home/Search/cat_search/cat_id/1/brand_id/<?php echo $v['brand_id']; ?>-<?php echo $v['brand_name']; ?>"><?php echo $v['brand_name']; ?></a></dd>
                    <?php endforeach; ?>
                </dl>
                    <?php endif; ?>
                <?php if(!I('get.price')): ?>
                <dl>
                    <dt>价格：</dt>
                    <?php foreach($searchFilter['price'] as $k => $v): ?>
                    <dd><a href="/index.php/Home/Search/cat_search/cat_id/1/price/<?php echo $v; ?>"><?php echo $v; ?></a></dd>
                    <?php endforeach; ?>
                </dl>
                <?php endif; ?>
                <!--筛选属性-->
                <?php foreach($searchFilter['gaData'] as $k => $v): $attrUrlName = 'attr_'.$v[0]['attr_id']; if(isset($_GET[attrUrlName])) continue; ?>
                <dl>
                    <dt><?php echo $k; ?>：</dt>
                    <?php foreach($v as $k1 => $v1): ?>
                    <dd><a href="/index.php/Home/Search/cat_search/cat_id/1/<?php echo $attrUrlName; ?>/<?php echo $v1['attr_value']; ?>-<?php echo $k; ?>"><?php echo $v1['attr_value']; ?></a></dd>
                    <?php endforeach; ?>
                </dl>
                <?php endforeach; ?>
            </div>
        </div>
        <!-- 商品筛选 end -->

        <div style="clear:both;"></div>

        <!-- 排序 start -->
        <?php $odby = I('get.odby','xl'); ?>
        <div class="sort mt10">
            <dl>
                <dt>排序：</dt>
                <dd <?php if($odby=='xl') echo 'class="cur"'; ?>><a href="<?php echo filterUrl('odby'); ?>/odby/xl">销量</a></dd>
                <dd <?php if(strpos($odby,'price_')===0) echo 'class="cur"'; ?>>
                <a href="<?php echo filterUrl('odby'); ?>/odby/<?php echo $odby=='price_desc'?'price_asc':'price_desc'; ?>">
                    价格
                    <?php if(strpos($odby,'price_')===0): ?>
                        <?php echo $odby == 'price_asc' ? '↓' : '↑'; ?>
                    <?php endif; ?>
                </a></dd>
                <dd <?php if($odby=='addtime') echo 'class="cur"'; ?>><a href="<?php echo filterUrl('odby'); ?>/odby/addtime">上架时间</a></dd>
                <dd><a href="">评论数</a></dd>
            </dl>
        </div>
        <!-- 排序 end -->

        <div style="clear:both;"></div>

        <!-- 商品列表 start-->
        <div class="goodslist mt10">
            <ul>
                <?php foreach($data as $k => $v): ?>
                <li>
                    <dl>
                        <dt><a href="<?php echo U('Index/goods/?id='.$v['id']); ?>"><?php showImage($v['mid_logo']); ?></a></dt>
                        <dt><a href="<?php echo U('Index/goods/?id='.$v['id']); ?>"><?php echo $v['goods_name']; ?></a></dt>
                        <dt><strong>￥<?php echo $v['shop_price']; ?></strong></dt>
                        <dt><a href=""><em>已有10人评价</em></a>
                            <a href=""><em>已有<?php echo (int)$v['xl']; ?></em></a>
                        </dt>
                    </dl>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <!-- 商品列表 end-->

        <!-- 分页信息 start -->
        <div class="page mt20">
            <ul>
                <li ><?php echo ($page); ?></li>
            </ul>
        </div>
        <!-- 分页信息 end -->

    </div>
    <!-- 列表内容 end -->
</div>
<!-- 列表主体 end-->

<script>
    <?php $config = C('IMAGE_CONFIG'); ?>
    var viewPath = '<?php echo $config['viewPath']; ?>';
    //记录浏览历史
    $.ajax({
        type:"GET",
        url : "<?php echo U('Index/displayHistory?id='.$info['id']);?>",
        dataType : "json",
        success : function (data)
        {
            var html = "";
            $(data).each(function(k,v)
            {
                html += '<dl><dt><a href="<?php echo U('goods','',false); ?>/id/'+v.id+'"><img src="'+viewPath+v.mid_logo+'"/></a></dt><dd>' + '<a href="<?php echo U('goods','',false); ?>/id/'+v.id+'">'+v.goods_name+'</a></dd></dl>'
            });
            $("#display_history").html(html);
        }
    });
</script>

<div style="clear:both;"></div>
<!-- 底部导航 start -->
<div class="bottomnav w1210 bc mt10">
    <div class="bnav1">
        <h3><b></b> <em>购物指南</em></h3>
        <ul>
            <li><a href="">购物流程</a></li>
            <li><a href="">会员介绍</a></li>
            <li><a href="">团购/机票/充值/点卡</a></li>
            <li><a href="">常见问题</a></li>
            <li><a href="">大家电</a></li>
            <li><a href="">联系客服</a></li>
        </ul>
    </div>

    <div class="bnav2">
        <h3><b></b> <em>配送方式</em></h3>
        <ul>
            <li><a href="">上门自提</a></li>
            <li><a href="">快速运输</a></li>
            <li><a href="">特快专递（EMS）</a></li>
            <li><a href="">如何送礼</a></li>
            <li><a href="">海外购物</a></li>
        </ul>
    </div>


    <div class="bnav3">
        <h3><b></b> <em>支付方式</em></h3>
        <ul>
            <li><a href="">货到付款</a></li>
            <li><a href="">在线支付</a></li>
            <li><a href="">分期付款</a></li>
            <li><a href="">邮局汇款</a></li>
            <li><a href="">公司转账</a></li>
        </ul>
    </div>

    <div class="bnav4">
        <h3><b></b> <em>售后服务</em></h3>
        <ul>
            <li><a href="">退换货政策</a></li>
            <li><a href="">退换货流程</a></li>
            <li><a href="">价格保护</a></li>
            <li><a href="">退款说明</a></li>
            <li><a href="">返修/退换货</a></li>
            <li><a href="">退款申请</a></li>
        </ul>
    </div>

    <div class="bnav5">
        <h3><b></b> <em>特色服务</em></h3>
        <ul>
            <li><a href="">夺宝岛</a></li>
            <li><a href="">DIY装机</a></li>
            <li><a href="">延保服务</a></li>
            <li><a href="">家电下乡</a></li>
            <li><a href="">礼品卡</a></li>
            <li><a href="">能效补贴</a></li>
        </ul>
    </div>
</div>
<!-- 底部导航 end -->






<div style="clear:both;"></div>
<!-- 底部版权 start -->
<div class="footer w1210 bc mt10">
    <p class="links">
        <a href="">关于我们</a> |
        <a href="">联系我们</a> |
        <a href="">人才招聘</a> |
        <a href="">商家入驻</a> |
        <a href="">千寻网</a> |
        <a href="">奢侈品网</a> |
        <a href="">广告服务</a> |
        <a href="">移动终端</a> |
        <a href="">友情链接</a> |
        <a href="">销售联盟</a>

    </p>
    <p class="copyright">
        © 2017-2020 礼拜天网上商城 版权所有，并保留所有权利。  ICP备案证书号:闽ICP证070359号
    </p>
    <p class="auth">
        <a href=""><img src="/Public/Home/images/xin.png" alt="" /></a>
        <a href=""><img src="/Public/Home/images/kexin.jpg" alt="" /></a>
        <a href=""><img src="/Public/Home/images/police.jpg" alt="" /></a>
        <a href=""><img src="/Public/Home/images/beian.gif" alt="" /></a>
    </p>
</div>
<!-- 底部版权 end -->

</body>
</html>

<script>
    $.ajax({
        type : "GET",
        url  : "<?php echo U('Member/ajaxChkLogin'); ?>",
        dataType : "json",
        success : function (data) {
            if(data.login == 1){
                var li = '您好，'+data.nickname+'<a href="<?php echo U('Member/logout'); ?>">  退出</a>';
            } else {
                var li = '您好，欢迎来到礼拜天商城！<a href="<?php echo U('Member/login'); ?>">登录</a><a href="<?php echo U('Member/regist'); ?>"> 免费注册</a>';

            }
            $("#logInfo").html(li);
        }
    });
</script>